﻿<%@ Page Title="" Language="C#" AutoEventWireup="true" CodeBehind="PopupSearchDatabase.aspx.cs"
	Inherits="WebApplication.Finance.PopupSearchDatabase" Theme="BaselineTheme" EnableTheming="true" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
	<title></title>
	<link href="../../Styles/StyleSheet.css" rel="stylesheet" type="text/css" />
</head>

<body style="margin-top:0px;">
	<form id="form1" runat="server">

	<!-- Error Message -->
	<asp:Panel runat="server" ID="pnlError">
		<div style="width:100%; height:32px; text-align:center; background-color:Red; padding:10px;" class="ErrorTextOnRed" >
			<asp:Label runat="server" ID="lbErrorMsg"></asp:Label>
		</div>
	</asp:Panel>
	<br />

	<!-- Search Parameters -->
	<div style="width:100%; text-align:center;">
	<div class="BorderedDiv" style="width:640px; margin:auto;">
		<div style="float: left; width: 300px;">
			<table cellpadding="3" cellspacing="0" border="0" class="DataTable" style="text-align: right">
				<tr>
					<td colspan="2" nowrap="nowrap">
						<h4>Debtor Details</h4>
					</td>
					<td style="text-align: right">
						<asp:CheckBox ID="chkSearchIncludeClosed" runat="server" Text="Include Closed" />
					</td>
				</tr>
				<tr>
					<td nowrap="nowrap">FRL Reference</td>
					<td colspan="2"><asp:TextBox ID="txtDebtorFRLRef" runat="server" Width="160px"></asp:TextBox>
					</td>
				</tr>
				<tr>
					<td nowrap="nowrap">Company Name</td>
					<td colspan="2"><asp:TextBox ID="txtDebtorCompName" runat="server" Width="160px"></asp:TextBox>
					</td>
				</tr>
				<tr>
					<td nowrap="nowrap">First Name</td>
					<td colspan="2"><asp:TextBox ID="txtDebtorFirstName" runat="server" Width="160px"></asp:TextBox>
					</td>
				</tr>
				<tr>
					<td nowrap="nowrap">Surname</td>
					<td colspan="2"><asp:TextBox ID="txtDebtorSurname" runat="server" Width="160px"></asp:TextBox>
					</td>
				</tr>
				<tr>
					<td nowrap="nowrap">Email</td>
					<td colspan="2"><asp:TextBox ID="txtDebtorEmail" runat="server" Width="160px"></asp:TextBox>
					</td>
				</tr>
				<tr>
					<td nowrap="nowrap">Postcode</td>
					<td colspan="2"><asp:TextBox ID="txtDebtorPostcode" runat="server" Width="80px"></asp:TextBox>
					</td>
				</tr>
				<tr>
					<td nowrap="nowrap">Telephone</td>
					<td colspan="2"><asp:TextBox ID="txtDebtorTel" runat="server" Width="160px"></asp:TextBox></td>
				</tr>
				<tr>
					<td nowrap="nowrap">Previous Payment</td>
					<td colspan="2"><asp:TextBox ID="txtDebtorPrevPay" runat="server"></asp:TextBox></td>
				</tr>
				<tr>
					<td nowrap="nowrap">Debt Value Between&nbsp;&nbsp; </td>
					<td colspan="2">
						<asp:TextBox ID="txtDebtorMin" runat="server" Width="50px"></asp:TextBox>
						and
						<asp:TextBox ID="txtDebtorMax" runat="server" Width="50px"></asp:TextBox></td>
				</tr>
				<tr align="right">
					<td></td>
					<td colspan="2" style="text-align: right">
						<asp:CheckBox ID="chkIncludeLPCDA" runat="server" Text="Include LPCDA" /></td>
				</tr>
			</table>
		</div>
		<div style="float: right; width: 300px;">
			<table cellpadding="3" cellspacing="0" border="0" class="DataTable" style="text-align: right">
				<tr>
					<td colspan="3" nowrap="nowrap">
						<h4>Client Details</h4>
					</td>
				</tr>
				<tr>
					<td nowrap="nowrap">Company Name</td>
					<td colspan="2"><asp:TextBox ID="txtCliCompName" runat="server"></asp:TextBox></td>
				</tr>
				<tr>
					<td nowrap="nowrap">Contact Name</td>
					<td colspan="2"><asp:TextBox ID="txtCliContName" runat="server"></asp:TextBox></td>
				</tr>
				<tr>
					<td nowrap="nowrap">Client Reference</td>
					<td colspan="2"><asp:TextBox ID="txtCliRef" runat="server"></asp:TextBox></td>
				</tr>
				<tr>
					<td></td>
					<td></td>
					<td style="text-align: right"><asp:Button ID="butSearch" runat="server" Text="Search" OnClick="butSearch_Click" />
					</td>
				</tr>
			</table>
		</div>
	</div>
	</div>

	<!-- Results Panel -->
	<asp:Panel ID="pnlResults" runat="server" Visible="false">
		<br />
		<table align="center">
			<tr>
				<td><h4>Search Results</h4></td>
			</tr>
			<tr>
				<td>
					<asp:GridView ID="gridResults" SkinID="BaseGridFonts" runat="server" AutoGenerateColumns="False" GridLines="None" BorderStyle="None">
						<Columns>
							<asp:BoundField DataField="AccountId" HeaderText="AccountId" ShowHeader="False" 
								Visible="False" />
							<asp:TemplateField>
								<ItemTemplate>
									<asp:CheckBox ID="chkIncAccount" runat="server" />
								</ItemTemplate>
							</asp:TemplateField>
							<asp:BoundField DataField="AccountRef" DataFormatString="{0}" HeaderText="Account">
								<ItemStyle Width="100px" />
							</asp:BoundField>
							<asp:BoundField DataField="ClientName" DataFormatString="{0}" HeaderText="Client">
								<ItemStyle Width="160px" />
							</asp:BoundField>
							<asp:BoundField DataField="DebtorName" DataFormatString="{0}" HeaderText="Debtor">
								<ItemStyle Width="160px" />
							</asp:BoundField>
							<asp:BoundField DataField="Amount" HtmlEncode="false" DataFormatString="{0:BC}" HeaderText="Debtor">
								<ItemStyle Width="100px" HorizontalAlign="Right" />
								<HeaderStyle HorizontalAlign="Right" />
							</asp:BoundField>
							<asp:BoundField DataField="StatusAsText" DataFormatString="{0}" HeaderText="Status">
								<ItemStyle Width="100px" HorizontalAlign="Center" />
								<HeaderStyle HorizontalAlign="Center" />
							</asp:BoundField>
						</Columns>
						<RowStyle HorizontalAlign="Left" />
						<HeaderStyle HorizontalAlign="Left" />
						<AlternatingRowStyle BackColor="AliceBlue" />
					</asp:GridView>
				</td>
			</tr>
			<tr>
				<td align="right">
					<asp:Button ID="butDebtChaser" runat="server" Text="Debt Chaser" OnClick="butDebtChaser_Click"
						SkinID="WebPartsDebtChaseButton" /></td>
			</tr>
			<tr>
				<td>&nbsp;</td>
			</tr>
		</table>
	</asp:Panel>
	</form>
</body>
</html>
